<!--<?php
print<<<EOT
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>自动清理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="styles/main.css" rel="stylesheet" type="text/css" />
<link href="templates/msystem/ljy.css" rel="stylesheet" type="text/css" />
<link href="ljy.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
function clickall()
{
        var fobj = document.getElementById('fll');
        var num = fobj.length;
        for(var i=0;i<num;i++)
        {
                if(fobj.elements[i].type=='checkbox')
                {
                        if(fobj.elements[i].checked==true)
                        {
                           fobj.elements[i].checked=false;
                        }
                        else
                        {
                           fobj.elements[i].checked=true;
                        }
                }
        }
}
</script>

<!-- 选择日期脚本  -->
<script language="javascript" type="text/javascript">
//// Powered by: amo
//// QQ:48176084
//// Email & MSN :phoubes@hotmail.com 

function PopupCalendar(InstanceName)
{
        ///Global Tag
        this.instanceName=InstanceName;
        ///Properties
        this.separator="-"
        this.oBtnTodayTitle="Today"
        this.oBtnCancelTitle="Cancel"
        this.weekDaySting=new Array("S","M","T","W","T","F","S");
        this.monthSting=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
        this.Width=200;
        this.currDate=new Date();
        this.today=new Date();
        this.startYear=1970;
        this.endYear=2010;
        ///Css
        this.divBorderCss="1px solid #BCD0DE";
        this.tableBorderColor="#CCCCCC"
        ///Method
        this.Init=CalendarInit;
        this.Fill=CalendarFill;
        this.Refresh=CalendarRefresh;
        this.Restore=CalendarRestore;
        ///HTMLObject
        this.oTaget=null;
        this.oPreviousCell=null;
        this.sDIVID=InstanceName+"oDiv";
        this.sTABLEID=InstanceName+"oTable";
        this.sMONTHID=InstanceName+"oMonth";
        this.sYEARID=InstanceName+"oYear";

}
function CalendarInit()                         ///Create panel
{
        var sMonth,sYear;
        sMonth=this.currDate.getMonth();
        sYear=this.currDate.getYear();
        htmlAll="<div id='"+this.sDIVID+"' style='display:none;position:absolute;width:"+this.Width+";border:"+this.divBorderCss+";padding:2px;background-color:#FFFFFF'>";
        htmlAll+="<div align='center'>";
        /// Month
        htmloMonth="<select id='"+this.sMONTHID+"' onchange=CalendarMonthChange("+this.instanceName+") style='width:50%'>";
        for(i=0;i<12;i++)
        {
                htmloMonth+="<option value='"+i+"'>"+this.monthSting[i]+"</option>";
        }
        htmloMonth+="</select>";
        /// Year
        htmloYear="<select id='"+this.sYEARID+"' onchange=CalendarYearChange("+this.instanceName+") style='width:50%'>";
        for(i=this.startYear;i<=this.endYear;i++)
        {
                htmloYear+="<option value='"+i+"'>"+i+"</option>";
        }
        htmloYear+="</select></div>";
        /// Day
        htmloDayTable="<table id='"+this.sTABLEID+"' width='100%' border=0 cellpadding=0 cellspacing=1 bgcolor='"+this.tableBorderColor+"'>";
        htmloDayTable+="<tbody bgcolor='#ffffff'style='font-size:13px'>";
        for(i=0;i<=6;i++)
        {
                if(i==0)
                        htmloDayTable+="<tr bgcolor='#98B8CD'>";
                else
                        htmloDayTable+="<tr>";
                for(j=0;j<7;j++)
                {

                        if(i==0)
                        {
                                htmloDayTable+="<td height='20' align='center' valign='middle' style='cursor:hand'>";
                                htmloDayTable+=this.weekDaySting[j]+"</td>"
                        }
                        else
                        {
                                htmloDayTable+="<td height='20' align='center' valign='middle' style='cursor:hand'";
                                htmloDayTable+=" onmouseover=CalendarCellsMsOver("+this.instanceName+")";
                                htmloDayTable+=" onmouseout=CalendarCellsMsOut("+this.instanceName+")";
                                htmloDayTable+=" onclick=CalendarCellsClick(this,"+this.instanceName+")>";
                                htmloDayTable+="&nbsp;</td>"
                        }
                }
                htmloDayTable+="</tr>";
        }
        htmloDayTable+="</tbody></table>";
        /// Today Button
        htmloButton="<div align='center' style='padding:3px'>"
        htmloButton+="<button style='width:40%;border:1px solid #BCD0DE;background-color:#eeeeee;cursor:hand'"
        htmloButton+=" onclick=CalendarTodayClick("+this.instanceName+")>"+this.oBtnTodayTitle+"</button>&nbsp;"
        htmloButton+="<button style='width:40%;border:1px solid #BCD0DE;background-color:#eeeeee;cursor:hand'"
        htmloButton+=" onclick=CalendarCancel("+this.instanceName+")>"+this.oBtnCancelTitle+"</button> "
        htmloButton+="</div>"
        /// All
        htmlAll=htmlAll+htmloMonth+htmloYear+htmloDayTable+htmloButton+"</div>";
        document.write(htmlAll);
        this.Fill();
}
function CalendarFill()                 ///
{
        var sMonth,sYear,sWeekDay,sToday,oTable,currRow,MaxDay,sDaySn,sIndex,rowIndex,cellIndex,oSelectMonth,oSelectYear;
        sMonth=this.currDate.getMonth();
        sYear=this.currDate.getYear();
        sWeekDay=(new Date(sYear,sMonth,1)).getDay();
        sToday=this.currDate.getDate();
        oTable=document.all[this.sTABLEID];
        currRow=oTable.rows[1];
        MaxDay=CalendarGetMaxDay(sYear,sMonth);

        oSelectMonth=document.all[this.sMONTHID]
        oSelectMonth.selectedIndex=sMonth;
        oSelectYear=document.all[this.sYEARID]
        for(i=0;i<oSelectYear.length;i++)
        {
                if(parseInt(oSelectYear.options[i].value)==sYear)oSelectYear.selectedIndex=i;
        }
        ////
        for(sDaySn=1,sIndex=sWeekDay;sIndex<=6;sDaySn++,sIndex++)
        {

                if(sDaySn==sToday)
                {
                        currRow.cells[sIndex].innerHTML="<font color=red><i><b>"+sDaySn+"</b></i></font>";
                        this.oPreviousCell=currRow.cells[sIndex];
                }
                else
                {
                        currRow.cells[sIndex].innerHTML=sDaySn;
                        currRow.cells[sIndex].style.color="#666666";
                }
                CalendarCellSetCss(0,currRow.cells[sIndex]);
        }
        for(rowIndex=2;rowIndex<=6;rowIndex++)
        {
                if(sDaySn>MaxDay)break;
                currRow=oTable.rows[rowIndex];
                for(cellIndex=0;cellIndex<currRow.cells.length;cellIndex++)
                {
                        if(sDaySn==sToday)
                        {
                                currRow.cells[cellIndex].innerHTML="<font color=red><i><b>"+sDaySn+"</b></i></font>";
                                this.oPreviousCell=currRow.cells[cellIndex];
                        }
                        else
                        {
                                currRow.cells[cellIndex].innerHTML=sDaySn;
                                currRow.cells[cellIndex].style.color="#666666";
                        }
                        CalendarCellSetCss(0,currRow.cells[cellIndex]);
                        sDaySn++;
                        if(sDaySn>MaxDay)break;
                }
        }
}
function CalendarRestore()                                      /// Clear Data
{
        var oTable;
        oTable=document.all[this.sTABLEID]
        for(i=1;i<oTable.rows.length;i++)
        {
                for(j=0;j<oTable.rows[i].cells.length;j++)
                {
                        CalendarCellSetCss(0,oTable.rows[i].cells[j]);
                        oTable.rows[i].cells[j].innerHTML="&nbsp;";
                }
        }
}
function CalendarRefresh(newDate)                                       ///
{
        this.currDate=newDate;
        this.Restore();
        this.Fill();
}
function CalendarCellsMsOver(oInstance)                         /// Cell MouseOver
{
        var myCell;
        myCell=event.srcElement;
        CalendarCellSetCss(0,oInstance.oPreviousCell);
        if(myCell)
        {
                CalendarCellSetCss(1,myCell);
                oInstance.oPreviousCell=myCell;
        }
}
function CalendarCellsMsOut(oInstance)                          ////// Cell MouseOut
{
        var myCell
        myCell=event.srcElement;
        CalendarCellSetCss(0,myCell);
}
function CalendarCellsClick(oCell,oInstance)
{
        var sDay,sMonth,sYear,newDate;
        sYear=oInstance.currDate.getFullYear();
        sMonth=oInstance.currDate.getMonth();
        sDay=oInstance.currDate.getDate();
        if(oCell.innerText!=" ")
        {
                sDay=parseInt(oCell.innerText);
                if(sDay!=oInstance.currDate.getDate())
                {
                        newDate=new Date(sYear,sMonth,sDay);
                        oInstance.Refresh(newDate);
                }
        }
        sDateString=sYear+oInstance.separator+CalendarDblNum(sMonth+1)+oInstance.separator+CalendarDblNum(sDay);                ///return sDateString
        if(oInstance.oTaget.tagName=="INPUT")
        {
                oInstance.oTaget.value=sDateString;
        }
        document.all[oInstance.sDIVID].style.display="none";
}
function CalendarYearChange(oInstance)                          /// Year Change
{
        var sDay,sMonth,sYear,newDate;
        sDay=oInstance.currDate.getDate();
        sMonth=oInstance.currDate.getMonth();
        sYear=document.all[oInstance.sYEARID].value
        newDate=new Date(sYear,sMonth,sDay);
        oInstance.Refresh(newDate);
}
function CalendarMonthChange(oInstance)                         /// Month Change
{
        var sDay,sMonth,sYear,newDate;
        sDay=oInstance.currDate.getDate();
        sMonth=document.all[oInstance.sMONTHID].value
        sYear=oInstance.currDate.getYear();
        newDate=new Date(sYear,sMonth,sDay);
        oInstance.Refresh(newDate);
}
function CalendarTodayClick(oInstance)                          /// "Today" button Change
{
        oInstance.Refresh(new Date());
}
function getDateString(oInputSrc,oInstance)
{
        if(oInputSrc&&oInstance) 
        {
                CalendarDiv=document.all[oInstance.sDIVID];
                oInstance.oTaget=oInputSrc;
                CalendarDiv.style.pixelLeft=CalendargetPos(oInputSrc,"Left");
                CalendarDiv.style.pixelTop=CalendargetPos(oInputSrc,"Top")+oInputSrc.offsetHeight;
                CalendarDiv.style.display=(CalendarDiv.style.display=="none")?"":"none";
        }
}
function CalendarCellSetCss(sMode,oCell)                        /// Set Cell Css
{
        // sMode
        // 0: OnMouserOut 1: OnMouseOver 
        if(sMode)
        {
                oCell.style.border="1px solid #5589AA";
                oCell.style.backgroundColor="#BCD0DE";
        }
        else
        {
                oCell.style.border="1px solid #FFFFFF";
                oCell.style.backgroundColor="#FFFFFF";
        }
}
function CalendarGetMaxDay(nowYear,nowMonth)                    /// Get MaxDay of current month
{
        var nextMonth,nextYear,currDate,nextDate,theMaxDay;
        nextMonth=nowMonth+1;
        if(nextMonth>11)
        {
                nextYear=nowYear+1;
                nextMonth=0;
        }
        else
        {
                nextYear=nowYear;
        }
        currDate=new Date(nowYear,nowMonth,1);
        nextDate=new Date(nextYear,nextMonth,1);
        theMaxDay=(nextDate-currDate)/(24*60*60*1000);
        return theMaxDay;
}
function CalendargetPos(el,ePro)                                /// Get Absolute Position
{
        var ePos=0;
        while(el!=null)
        {
                ePos+=el["offset"+ePro];
                el=el.offsetParent;
        }
        return ePos;
}
function CalendarDblNum(num)
{
        if(num<10) 
                return "0"+num;
        else
                return num;
}
function CalendarCancel(oInstance)                      ///Cancel
{
        CalendarDiv=document.all[oInstance.sDIVID];
        CalendarDiv.style.display="none";
}

</script>
<script >
var oCalendarEn=new PopupCalendar("oCalendarEn");
oCalendarEn.Init();
var oCalendarChs=new PopupCalendar("oCalendarChs");
oCalendarChs.weekDaySting=new Array("日","一","二","三","四","五","六");
oCalendarChs.monthSting=new Array("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月");
oCalendarChs.oBtnTodayTitle="今天";
oCalendarChs.oBtnCancelTitle="取消";
oCalendarChs.Init();
</script>
<script type="text/javascript">
function clickall()
{
        var fobj = document.getElementById('fll');
        var num = fobj.length;
        for(var i=0;i<num;i++)
        {
                if(fobj.elements[i].type=='checkbox')
                {
                        if(fobj.elements[i].checked==true)
                        {
                           fobj.elements[i].checked=false;
                        }
                        else
                        {
                           fobj.elements[i].checked=true;
                        }
                }
        }
}
</script>
<script type="text/javascript">
var t,hash;
var id=0;
var allnum;
function ajaxresponse(arg)
{

        processfile=arg;
		arg=parseInt(arg);
        //alert(arg);
        allnum=document.getElementById('allnum').value;
		allnum=parseInt(allnum);
        document.getElementById('delinfo').innerHTML='当前已经成功删除：'+arg+'条记录/共'+allnum+'条';
        if(allnum>arg)
        {
                clearTimeout(t);
                t=setTimeout('dela()',3000);
        }else
        {
                document.getElementById('delinfo').innerHTML='当前已经成功删除完毕！！！';
                alert(arg);
        }
}

function dela()
{

        id++;
        //alert(document.getElementById('allnum').value+'id='+id);
        hash=document.getElementById('hash'+id).value;
        //alert(hash);
        send_request('del_request.php','hash='+hash+'&nn='+id);
}
//dela();
</script>
<script src="ajax.js" type="text/jscript"></script>

</head>
<base target="_self" />
<body style="text-align:left; font-size:12px;">
<div  id="toppath">ACS 手动清理</div>
<div id="delinfo"  style="color:#FF0000; size:34px"  >
</div>

<div style="height:28px; border:#A4E1F9 solid 1px; width:100%; color:#ff0000; padding-top:5px;margin-top:20px; margin-bottom:0px; background:#A4E1F9"><strong>&nbsp;提示信息:以下操作请谨慎进行！</strong></div>

  <form name="detebtc"  method="post" action="delebtc.inc.php">
<input type="hidden" name="action" value="search" />
<table width="100%" border="0" cellpadding="3" cellspacing="0">
  <tr>
    <tH width="45%">按条件进行查询</tH>
    <tH width="55%">&nbsp;</tH>
  </tr>
  <tr>
    <td class="table_left"><strong>文件存在时间:</strong><br />
      (例:2008-04-24 09:00:00)</td>
    <td><span style=" margin:0 0 0 20px;">
      <select name="upp" >
        <option value='0' selected="selected">等于</option>
        <option value='1'>大于</option>
        <option value='-1'>小于</option>
      </select>
      <input type="text" class="input1" name="uptime" size="5" value="$uptime" style="height:22px;width:120px;" onClick="getDateString(this,oCalendarChs)"/>
    </span></td>
  </tr>
  <tr>
    <td class="table_left"><strong>关键字判断:</strong><br />
      多个关键字请用| 隔开，例如：色戒|梁朝伟</td>
    <td><span style=" margin:0 0 0 20px;">
      <input type="text" class="input1" name="corkey" size="20" value="$corkey" style="height:22px;width:179px;"/>
    </span></td>
  </tr>
  <tr>
    <td class="table_left"><strong>文件热度:</strong><br />
      请填入范围为0-9的一个或多个数字</td>
    <td><span style=" margin:0 0 0 20px;">
      <select name="hotpp" >
        <option value='0' selected="selected">等于</option>
        <option value='1'>大于</option>
        <option value='-1'>小于</option>
      </select>
      <input type="text" name="hotnum" class="input1" size="20" value="$hotnum" style="height:22px;width:120px;"/>
    </span></td>
  </tr>
  <tr>
    <td class="table_left"><strong>文件缓存是否完成: </strong></td>
    <td><span style=" margin:0 0 0 20px;">
      <input type="radio" name="ifcom" value="1" $com1 />
      是
      <input type="radio" name="ifcom" value="0" $com2 />
    否</span></td>
  </tr>
  <tr>
   <tr>
    <td class="table_left"><strong>ACS分组ID:</strong> <br />
      目前范围为1-13，可填入范围内的组号</td>
    <td><span style=" margin:0 0 0 20px;">
      <input type="text" name="fbtcid"  size="20" value="$fbtcid" style="height:22px;width:179px;" />
     </span></td>
  </tr>
  <tr> 
    <td class="table_left">数据库缓存文件的唯一标识ID:<br />
      请填入范围为0-9的一个或多个数字</td>
    <td><span style=" margin:0 0 0 20px;">
      <select style="height:15px;" name="equal">
        <option value="1">大于</option>
        <option value="2">等于</option>
        <option value="3">小于</option>
      </select>
      <input type="text" class="input1" name="id" style="height:22px;width:120px;"/>
    </span></td>
  </tr>
  <tr>
    <td class="table_left"><strong>HASH:</strong><br />
      种子的唯一标识</td>
    <td><span style=" margin:0 0 0 20px;">
      <input type="text" class="input1" name="hash"  style="height:22px;width:179px;"/>
      <input type="submit" name="sum" class="input1" style="background: #FFCC00; width:100PX;" value="查询" />
    </span></td>
  </tr>
</table>

<!--磁盘剩余空间:<input  class="input1" type="text" name="diskfree" value="$diskfree" size="2" style="margin-right:30px;height:22px;"/>--><br>

</form>

<form name="fll" method="post" action="delebtc.inc.php" >
<input type="hidden" name="action" value="del" />
<input type="hidden" name="wheresql" value="$nextsql" />
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="color:#666666;font-size:13px;">
<tr>
  <th>以下为符合条件的结果</th>
</tr>
<tr>
  <td>
  <!--
EOT;
$num=count($delall);

foreach($delall as $key=>$delhash)
{$id=$key+1;
print<<<EOT
--> 
<input type=hidden id=hash{$id} value="{$delhash[hash]}">
<!--
EOT;
}print<<<EOT
-->

    <input type=hidden id=allnum value="{$num}">

  </td>
</tr>
<!--
EOT;
foreach($detedb as $deteli)
{print<<<EOT
-->

<tr><td><p><input type="checkbox" name="detehash[]" value="$deteli[hash]" />$deteli[seedname]</p></td></tr>
<!--
EOT;
}print<<<EOT
-->
</table>

<div align="center" id="pagediv">
 <p>{$pages}
 </p>
</div>
<div  id="pagediv">
<input class="submit" type="button" value="全删除" onclick="dela();" />
<input class="submit" type="button" value="全选" onclick="clickall();" />
<input class="submit" type="submit" name="gf" value="删除" />
<input class="submit" type="submit" name="ifyellow" value="屏蔽" />
<input class="submit" type="reset" value="重置"/>
</div>
</form>
</body>
</html>
<!--
EOT;
?>-->
